package Application.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import Application.entity.Record;
import Application.entity.Result;
import Application.service.RecordService;

@CrossOrigin	
@RestController
@RequestMapping("/Record")
public class RecordControl {

	@Resource
	private RecordService service;
	
	@PostMapping("/insertRecord")
	public Result insertRecord(Record record) {
		System.out.println(record);
		return service.insertRecord(record);
		
	}
	@PostMapping("/findRecords")
	public List<Record> findRecords(Record record){
		return service.findRecords(record);
	}
}
